;---------------------------------------------------------------------------
;High Missile Shot
[Statedef 1000]
type    = S
movetype= I
physics = S
poweradd = 40
velset = 0,0
anim = 1000
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1000, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 3]
type = Helper
trigger1 = AnimElem = 4
name = "High Missile" 
ID = 1000
stateno = 1001
pos = ceil(41*const(size.xscale)),ceil(-45*const(size.yscale))
postype = p1
facing = 1
ownpal = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1000, 4]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1000, 5]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1000, 6]
type = VarRandom
trigger1 = var(59) && Time >= 1
v = 11
range = 0,2

[State 1000, 7]
type = VarAdd
trigger1 = AnimElem = 4
var(37) = 1

[State 1000, 8]
type = StateTypeSet
trigger1 = Time = 10
movetype = A

[State 1000, 9]
type = StateTypeSet
trigger1 = Time = 13
movetype = I

[State 1000, 10]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1000,0

[State 1000, 11]
type = RemapPal
trigger1 = AnimElem = 3
source = 1,1
dest = 2,PalNo

[State 1000, 12]
type = VarSet
trigger1 = AnimElem = 3
var(13) = 1

[State 1000, 13]
type = RemapPal
trigger1 = AnimElem = 6
source = 1,1
dest = 1,PalNo

[State 1000, 14]
type = VarSet
trigger1 = AnimElem = 6
var(13) = 0

[State 1000, 15]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;High Missile Shot
[Statedef 1001]
type    = S
movetype= A
physics = N
velset = (6+(IfElse(parent,Var(11) = 1,2,IfElse(parent,Var(11) = 2,-1,0))))*const(size.xscale),0
anim = 1001
ctrl = 0
sprpriority = 3

[State 1001, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1001, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1002
time = -1
ignorehitpause = 1

[State 1001, 3]
type = HitDef
trigger1 = root,var(5) < 6
attr = S, SP
damage = ceil(80*root,Fvar(20)),20
animtype = Hard
guardflag = MA
hitflag = HAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 30
guard.slidetime = 29
ground.hittime  = 31
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1000
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1001, 7]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1001, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1001, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1001, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1001, 11]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1001, 12]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1001, 13]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1002+(1*!MoveContact && FrontEdgeDist < -40)

;-------------------------------------------------------------------------
;Missile Explod
[Statedef 1002]
type    = A
movetype= I
physics = N
anim = 1002
ctrl = 0
velset = 0,0

[State 1002, 1]
type = PowerAdd
trigger1 = !Time && root,Var(53) = 0
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1002, 2]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1002, 3]
type = ChangeAnim
trigger1 = !AnimTime
value = 1

[State 1002, 4]
type = ParentVarAdd
trigger1 = Anim = 1
var(37) = -1

[State 1002, 5]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L 
;-------------------------------------------------------------------------
;Missile Explod
[Statedef 1003]
type    = A
movetype= I
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 1003, 1]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1

[State 1003, 2]
type = DestroySelf
trigger1 = !Time
;---------------------------------------------------------------------------
;Missile Shot (Air)
[Statedef 1005]
type    = A
movetype= I
physics = N
poweradd = 40
anim = 1005
ctrl = 0
sprpriority = 2

[State 1005, 1]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1005, 2]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1005, 3]
type = VarRandom
trigger1 = var(59) && Time >= 1
v = 11
range = 0,2

[State 1005, 4]
type = VarSet
trigger1 = !Time
fvar(10) = Vel X

[State 1005, 5]
type = VarSet
trigger1 = !Time
fvar(11) = Vel Y

[State 1005, 6]
type = Helper
trigger1 = AnimElem = 4
name = "Air Missile" 
ID = 1000
stateno = 1006
pos = ceil(41*const(size.xscale)),ceil(-47*const(size.yscale))
postype = p1
facing = 1
ownpal = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1005, 7]
type = VarAdd
trigger1 = AnimElem = 4
var(37) = 1

[State 1005, 8]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1000,0
channel = 0

[State 1005, 9]
type = VelSet
trigger1 = !Time
x = (-.2*(-1*(fvar(10) > 0) + 1*(fvar(10) < 0)))*const(size.xscale)
y = (-.2*(-1*(fvar(11) > 0) + 1*(fvar(11) < 0)))*const(size.yscale)

[State 1005, 10]
type = VelSet
trigger1 = Pos Y >= 0 && Vel Y != 0 && AnimElemTime(4) <= 0
x = 0
y = 0

[State 1005, 11]
type = VelSet
trigger1 = AnimElem = 4
x = -1.8*const(size.xscale)
y = -2*const(size.yscale)

[State 1005, 12]
type = VelAdd
trigger1 = Time > 9
y = .44*const(size.yscale)

[State 1005, 13]
type = StateTypeSet
trigger1 = Time = 8
movetype = A

[State 1005, 14]
type = StateTypeSet
trigger1 = Time = 10
movetype = I

[State 1005, 15]
type = RemapPal
trigger1 = AnimElem = 3
source = 1,1
dest = 2,PalNo

[State 1005, 16]
type = VarSet
trigger1 = AnimElem = 3
var(13) = 1

[State 1005, 17]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 18
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1005, 18]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 18
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1005, 19]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y && Time > 9
value = 1007
;---------------------------------------------------------------------------
;Air Missile Shot
[Statedef 1006]
type    = S
movetype= A
physics = N
velset = (7+(IfElse(parent,Var(11) = 1,2,IfElse(parent,Var(11) = 2,-1,0))))*const(size.xscale),0
anim = 1001
ctrl = 0
sprpriority = 3

[State 1006, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1006, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1002
time = -1
ignorehitpause = 1

[State 1006, 3]
type = HitDef
trigger1 = root,var(5) < 6
attr = S, SP
damage = ceil(80*root,Fvar(20)),20
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 30
guard.slidetime = 29
ground.hittime  = 31
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1000
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0,0
givepower = 25,13

[State 1006, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1006, 5]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1006, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1006, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1006, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1006, 9]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1006, 10]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1002+(1*!MoveContact && FrontEdgeDist < -40)
;---------------------------------------------------------------------------
;Missile Shot (Land)
[Statedef 1007]
type    = S
movetype= I
physics = N
anim = 1007
velset = 0,0
ctrl = 0
sprpriority = 2

[State 1007, 1]
type = PosSet
trigger1 = !Time
y = 0

[State 1007, 2]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;High Freeze Beam(Ground)
[Statedef 1010]
type    = S
movetype= I
physics = S
poweradd = -500
velset = 0,0
anim = 1010
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1010, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1010, 2]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1010, 3]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 4]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 223,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 5]
type = Helper
trigger1 = AnimElem = 4
name = "Freeze Beam" 
ID = 1010
stateno = 1011
pos = ceil(35*const(size.xscale)),ceil(-45*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1010, 6]
type = VarAdd
trigger1 = AnimElem = 4
var(37) = 1

[State 1010, 7]
type = StateTypeSet
trigger1 = Time = 10
movetype = A

[State 1010, 8]
type = StateTypeSet
trigger1 = Time = 13
movetype = I

[State 1010, 9]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1010,0

[State 1010, 10]
type = ChangeState
trigger1 = !Var(59) && Time = 4 && (NumExplod(90000002) || NumExplod(90000003) || NumExplod(90000001))
value = 1060

[State 1010, 111]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Freeze Beam
[Statedef 1011]
type    = S
movetype= A
physics = N
anim = 1011
velset = 6*const(size.xscale),0
ctrl = 0
sprpriority = 3

[State 1011, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1011, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1012
time = -1
ignorehitpause = 1

[State 1011, 3]
type = HitDef
trigger1 = root,var(5) < 6 && ((root,Var(12) & (2**0)) = 0) 
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.type = High
ground.slidetime = 70
guard.slidetime = 30
ground.hittime  = 70
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1011, 3]
type = HitDef
trigger1 = root,var(5) < 6 && ((root,Var(12) & (2**0)) = 1) 
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = S6000
hitsound = F5,0
guardsound = F6, 0
ground.type = High
ground.slidetime = 28
guard.slidetime = 30
ground.hittime  = 30
guard.hittime = 30
ground.velocity = -3*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -1.9*const(size.xscale), -1.5*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1011, 4]
type = TargetState
triggerall = NumTarget && MoveHit && ((root,Var(12) & (2**0)) = 0)
trigger1 = HitPauseTime = 1
value = 5490
ignorehitpause = 1

[State 1011, 5]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1011, 6]
type = ParentVarSet
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 0
ignorehitpause = 1

[State 1011, 7]
type = ParentVarSet
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(12) = Var(12) | (2**0)
ignorehitpause = 1

[State 1011, 8]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1011, 9]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1011, 10]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1011, 11]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1011, 12]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1012-(9*(!MoveContact && FrontEdgeDist < -40))

;-------------------------------------------------------------------------
;Freeze Beam Hit
[Statedef 1012]
type    = A
movetype= I
physics = N
anim = 1
ctrl = 0
velset = 0,0

[State 1012, 1]
type = Null
trigger1 = !Time
value = 50-25*(NumTarget && MoveGuarded)
ignorehitpause = 1

[State 1012, 1]
type = ParentVarAdd
trigger1 = !Time
var(37) = -1
ignorehitpause = 1

[State 1012, 2]
type = DestroySelf
trigger1 = !NumTarget && Anim = 1
trigger2 = NumTarget && Anim = 1
trigger2 = target,StateType = L
;---------------------------------------------------------------------------
;Frozen
[Statedef 1013]
type    = U
movetype= H
physics = N
velset = 0,0
ctrl = 0
sprpriority = -2

[State 1013, 1]
type = ChangeAnim2
trigger1 = !Time
value = 5000

[State 1013, 2]
type = PalFX
trigger1 = Time < 50
time = 1
add = 0,80,256
mul = 0,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 1013, 2]
type = PalFX
trigger1 = Time >= 50 && (GameTime % 2 = 0)
time = 1
add = 0,80,256
mul = 0,256,256
sinadd = 0,0,0,1
invertall = 0
color = 256

[State 1013, 3]
type = SelfState
triggerall = StateType != A
trigger1 = Time = 70
value = 0
ctrl = 1

[State 1013, 4]
type = SelfState
triggerall = Time = 70
trigger1 = StateType = A
trigger2 = Pos Y < 0
value = 5040
;---------------------------------------------------------------------------
;Freeze Beam (Air)
[Statedef 1015]
type    = A
movetype= I
physics = N
poweradd = -500
anim = 1015
ctrl = 0
sprpriority = 2

[State 1010, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1010, 2]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1010, 3]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 18
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 4]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 223,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 18
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1010, 5]
type = Helper
trigger1 = AnimElem = 4
name = "Freeze Beam" 
ID = 1015
stateno = 1016
pos = ceil(39*const(size.xscale)),ceil(-47*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1010, 6]
type = VarAdd
trigger1 = AnimElem = 4
var(37) = 1

[State 1010, 7]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1010,0

[State 1010, 8]
type = VarSet
trigger1 = !Time
fvar(10) = Vel X

[State 1010, 9]
type = VarSet
trigger1 = !Time
fvar(11) = Vel Y

[State 1010, 10]
type = VelSet
trigger1 = !Time
x = (-.2*(-1*(fvar(10) > 0) + 1*(fvar(10) < 0)))*const(size.xscale)
y = (-.2*(-1*(fvar(11) > 0) + 1*(fvar(11) < 0)))*const(size.yscale)

[State 1010, 11]
type = VelAdd
trigger1 = Time > 9
y = .44*const(size.yscale)

[State 1010, 12]
type = StateTypeSet
trigger1 = Time = 8
movetype = A

[State 1010, 13]
type = StateTypeSet
trigger1 = Time = 10
movetype = I

[State 1005, 14]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y && Time > 9
value = 1007
;---------------------------------------------------------------------------
;Freeze Beam
[Statedef 1016]
type    = S
movetype= A
physics = N
anim = 1011
velset = 6*const(size.xscale),0
ctrl = 0
sprpriority = 3

[State 1016, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1016, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1012
time = -1
ignorehitpause = 1

[State 1016, 3]
type = HitDef
trigger1 = root,var(5) < 6 && ((root,Var(12) & (2**1)) = 0) 
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.slidetime = 70
guard.slidetime = 30
ground.hittime  = 70
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1016, 4]
type = HitDef
trigger1 = root,var(5) < 6 && ((root,Var(12) & (2**1)) = 1) 
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = S6000
hitsound = F5,0
guardsound = F6, 0
ground.type = High
ground.slidetime = 28
guard.slidetime = 28
ground.hittime  = 30
guard.hittime = 30
ground.velocity = -3*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -1.9*const(size.xscale), -1.5*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1016, 5]
type = TargetState
triggerall = NumTarget && MoveHit && ((root,Var(12) & (2**1)) = 0)
trigger1 = HitPauseTime = 1
value = 5490
ignorehitpause = 1

[State 1016, 6]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1016, 7]
type = ParentVarSet
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 0
ignorehitpause = 1

[State 1016, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(12) = Var(12) | (2**1)
ignorehitpause = 1

[State 1016, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1016, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1016, 11]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1016, 12]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1016, 13]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1012-(9*(!MoveContact && FrontEdgeDist < -40))
;---------------------------------------------------------------------------
;Low Missile Shot
[Statedef 1050]
type    = S
movetype= I
physics = S
poweradd = 40*(1-var(53))
velset = 0,0
anim = 1050
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1050, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8030
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 44
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8030
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 44
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1050, 3]
type = Helper
trigger1 = AnimElem = 3
name = "Low Missile" 
ID = 1000
stateno = 1051
pos = ceil(54*const(size.xscale)),ceil(-13*const(size.yscale))
postype = p1
facing = 1
ownpal = 0
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1050, 4]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1050, 5]
type = VarSet
trigger1 = Time >= 1
var(11) = Cond(Cond(Facing = 1, NumExplod(90000006), NumExplod(90000004)),1,Cond(Cond(Facing = 1, NumExplod(90000004), NumExplod(90000006)),2,0))

[State 1050, 5]
type = VarSet
trigger1 = var(53)
var(11) = 2

[State 1050, 6]
type = VarAdd
trigger1 = AnimElem = 4
var(37) = 1

[State 1050, 7]
type = VarRandom
triggerall = var(59)
trigger1 = Time >= 1
v = 11
range = 0,2

[State 1050, 8]
type = Width
trigger1 = Time >= 5 && Time < 28
value = ceil(35*const(size.xscale)),0

[State 1050, 9]
type = StateTypeSet
trigger1 = Time = 7
movetype = A

[State 1050, 10]
type = StateTypeSet
trigger1 = Time = 9
movetype = I 

[State 1050, 11]
type = RemapPal
trigger1 = AnimElem = 3
source = 1,1
dest = 2,PalNo

[State 1050, 12]
type = VarSet
trigger1 = AnimElem = 3
var(13) = 1

[State 1050, 13]
type = RemapPal
trigger1 = AnimElem = 6
source = 1,1
dest = 1,PalNo

[State 1050, 14]
type = VarSet
trigger1 = AnimElem = 6
var(13) = 0

[State 1050, 15]
type = PlaySnd
trigger1 = AnimElem = 2
value = S1000,0

[State 1050, 16]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Low Missile
[Statedef 1051]
type    = S
movetype= A
physics = N
velset = (4+(IfElse(parent,Var(11) = 1,2,IfElse(parent,Var(11) = 2,-1,0))))*const(size.xscale),0
anim = 1001
ctrl = 0
sprpriority = 2

[State 1051, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1051, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1002
time = -1
ignorehitpause = 1

[State 1051, 3]
type = HitDef
trigger1 =  root,var(5) < 6
attr = S, SP
damage = ceil(60*root,Fvar(20)),15
animtype = Hard
getpower = 0,0
givepower = 25,13
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = F5, 3
guardsound = F6, 0
ground.type = Low
ground.slidetime = 30
guard.slidetime = 29
ground.hittime  = 31
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = Low
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1050
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1051, 4]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1051, 5]
type = ParentVarAdd
trigger1 = HitPauseTime = 1
var(5) = 1
ignorehitpause = 1

[State 1051, 6]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1051, 7]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1051, 8]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1051, 9]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1002+(1*!MoveContact && FrontEdgeDist < -40)
;---------------------------------------------------------------------------
;Low Freeze Beam
[Statedef 1060]
type    = S
movetype= I
physics = S
poweradd = 0
velset = 0,0
anim = 1060
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1060, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1060, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8031
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 44
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 3]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8031
ID = 8030
pos = 223,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 44
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1060, 4]
type = Helper
trigger1 = AnimElem = 3
name = "Freeze Beam" 
ID = 1060
stateno = 1061
pos = ceil(42*const(size.xscale)),ceil(-11*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1060, 5]
type = VarAdd
trigger1 = AnimElem = 3
var(37) = 1

[State 1060, 6]
type = Width
trigger1 = Time >= 5 && Time < 28
value = ceil(35*const(size.xscale)),0 

[State 1060, 7]
type = StateTypeSet
trigger1 = Time = 7
movetype = A

[State 1060, 8]
type = StateTypeSet
trigger1 = Time = 9
movetype = I 

[State 1060, 9]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1010,0

[State 1060, 10]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Low Freeze Beam
[Statedef 1061]
type    = S
movetype= A
physics = N
anim = 1011
velset = 6*const(size.xscale),0
ctrl = 0
sprpriority = 3

[State 1061, 1]
type = HitBy
trigger1 = 1
value = SCA,SP,HP
time = -1

[State 1061, 2]
type = HitOverride
trigger1 = 1
attr = SCA,SP,HP
slot = 0
stateno = 1012
time = -1
ignorehitpause = 1

[State 1061, 3]
type = HitDef
triggerall = root,var(5) < 6 && ((root,Var(12) & (2**2)) = 0) 
trigger1 = !Time
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = -1
hitsound = -1
guardsound = F6, 0
ground.slidetime = 70
guard.slidetime = 30
ground.hittime  = 70
guard.hittime = 30
ground.velocity = -6.4*const(size.xscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -4.1*const(size.xscale),-3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1061, 4]
type = HitDef
triggerall = root,var(5) < 6 && ((root,Var(12) & (2**2)) = 1) 
trigger1 = !Time
attr = S, SP
damage = ceil(30*root,Fvar(20)),8
animtype = Hard
guardflag = MA
hitflag = MAF
getpower = 0,0
givepower = 25,13
priority = 4, Hit
pausetime = 1,1
sparkno = S6000
hitsound = F5,0
guardsound = F6, 0
ground.type = High
ground.slidetime = 28
guard.slidetime = 28
ground.hittime  = 30
guard.hittime = 30
ground.velocity = -3*const(size.xscale)
air.type = High
air.hittime = 100
air.velocity = -1.9*const(size.xscale), -1.5*const(size.yscale)
yaccel = .35*const(size.yscale)
id = 1010
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1061, 5]
type = TargetState
triggerall = NumTarget && MoveHit && ((root,Var(12) & (2**2)) = 0)
trigger1 = HitPauseTime = 1
value = 5490
ignorehitpause = 1

[State 1061, 6]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1061, 7]
type = ParentVarSet
triggerall = NumTarget && MoveHit && P2StateType = A
trigger1 = HitPauseTime = 1
var(5) = 0
ignorehitpause = 1

[State 1061, 8]
type = ParentVarAdd
triggerall = NumTarget && MoveHit
trigger1 = HitPauseTime = 1
var(12) = Var(12) | (2**2)
ignorehitpause = 1

[State 1061, 9]
type = VarSet
trigger1 = 1
fvar(1) = P2BodyDist X 

[State 1061, 10]
type = VarSet
trigger1 = 1
fvar(2) = P2BodyDist Y 

[State 1061, 11]
type = ParentVarAdd
triggerall = NumTarget && MoveHit && Var(7) < 150 && !NumHelper(7000) && !NumHelper(7050)
trigger1 = HitPauseTime = 1
var(7) = 5
ignorehitpause = 1

[State 1061, 12]
type = VarSet
trigger1 = NumTarget && MoveContact
var(0) = 1
ignorehitpause = 1

[State 1061, 13]
type = ChangeState
trigger1 = MoveContact || FrontEdgeDist < -40
value = 1012-(9*(!MoveContact && FrontEdgeDist < -40))
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1100]
type    = S
movetype= A
physics = S
poweradd = 60*(1-var(53))
velset = 0,0
anim = 1100+(3*(NumExplod(90000230) != 0))
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1100, 1]
type = VarSet
trigger1 = !var(59) && !Time
var(10) = NumExplod(90000230) != 0 && !Var(53)

[State 1100, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8032
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 3]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8032
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 3]
type = NotHitBy
trigger1 = !Time
value = SCA
time = 7-(1*Var(10))

[State 1100, 4]
type = AssertSpecial
trigger1 = (GameTime % 2) = 0
flag = invisible

[State 1100, 5]
type = VelSet
trigger1 = AnimElem = 2
x = (9.7-3*Var(10))*const(size.xscale)

[State 1100, 6]
type = HitDef
trigger1 = Var(5) < 6 && !Time
attr = S, SA
damage = ceil(50*Fvar(20)),13
animtype = Up
getpower = 24*(1-var(53)),12*(1-var(53))
givepower = 12,6
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 12,12
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = .5*const(size.xscale), -2.4*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = .3*const(size.xscale),-1.6*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1100, 7]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1100, 8]
type = Width
trigger1 = AnimElemTime(3) >= 0
player = ceil(-10*const(size.xscale)),ceil(-10*const(size.xscale))
ignorehitpause = 1

[State 1100, 9]
type = PlayerPush
trigger1 = AnimElemTime(3) >= 0
value = 0

[State 1100, 10]
type = ChangeState
trigger1 = !AnimTime
value = 1101
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1101]
type    = A
movetype= A
physics = N
velset = 0,(-9.25+1.15*Var(10))*const(size.yscale)
anim = 1101
ctrl = 0
sprpriority = 2
hitcountpersist = 1

[State 1101, 1]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 1101, 2]
type = HitDef
triggerall = (P2MoveType = H && P2StateNo != [120,160]) && HitCount > 1 || (HitCount = 1 && AnimElem = 1)
trigger1 = (AnimElem = 1 || AnimElem = 2 || AnimElem = 3) && ((!Var(10) && Time < 12) || (Var(10) && HitCount < 2))
attr = S, SA
damage = ceil(20*Fvar(20)),5
animtype = Up
getpower = 24*(1-var(53)),12*(1-var(53))
givepower = 12,6
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8,8
sparkno = S6001
sparkxy = -9,ceil(-31*const(size.yscale))
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = ifelse(P2Dist X > 0, 1.2 ,-1.5)*const(size.xscale), -6.5*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = ifelse(P2Dist X > 0, .8 ,-1.2)*const(size.xscale), -5.5*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1101, 3]
type = HitDef
triggerall = (P2MoveType = H && P2StateNo != [120,160]) && ((!Var(10) && HitCount > 1) || Var(10) && HitCount = 2)
trigger1 = ((!Var(10) && AnimElem = 4) || (Var(10) && AnimElem = 3)) && (Time < 12)
attr = S, SA
damage = ceil(20*Fvar(20)),5
animtype = Up
getpower = 24*(1-var(53)),12*(1-var(53))
givepower = 12,6
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = -2.1*const(size.xscale), -4.5*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.1*const(size.xscale), -4.5*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1101, 4]
type = HitDef
triggerall = Var(5) < 6 && !HitCount
trigger1 = !Time
attr = S, SA
damage = ceil(75*Fvar(20)),19
animtype = Up
getpower = 60*(1-var(53)), 30*(1-var(53))
givepower = 30, 15
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = -3.1*const(size.xscale), -4.1*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -3.1*const(size.xscale), -4.1*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 0

[State 1101, 4]
type = Width
trigger1 = 1 
player = ceil(-11*const(size.xscale)),ceil(-11*const(size.xscale))
ignorehitpause = 1

[State 1101, 5]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3 && HitCount = 1
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1101, 6]
type = PlayerPush
trigger1 = 1
value = 0

[State 1101, 7]
type = PlaySnd
trigger1 = !Time 
value = S190,0

[State 1101, 8]
type = ChangeState
trigger1 = Vel Y >= 0
value = 1102
;---------------------------------------------------------------------------
;Screw Attack (End)
[Statedef 1102]
type    = A
movetype= I
physics = N
velset = 0,Vel Y
anim = 44
ctrl = 0
sprpriority = 2

[State 1102, 1]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 1102, 2]
type = RemoveExplod
trigger1 = !Time
id = 8030

[State 1102, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1007

;---------------------------------------------------------------------------
;EX Screw Attack
[Statedef 1110]
type    = S
movetype= A
physics = S
poweradd = -500
velset = 0,0
anim = 1100
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1110, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8033
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1110, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8033
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1110, 3]
type = NotHitBy
trigger1 = 1
value = SCA
time = 3

[State 1110, 4]
type = VelSet
trigger1 = AnimElem = 2
x = 9.7*const(size.xscale)

[State 1110, 5]
type = HitDef
trigger1 = Var(5) < 6 && !Time
attr = S, SA
damage = ceil(70*Fvar(20)),18
animtype = Up
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
givepower = 12,6
pausetime = 12,12
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = .1*const(size.xscale), -6.4*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -.3*const(size.xscale),-5.3*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1110
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1110, 6]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1110, 7]
type = Width
trigger1 = AnimElemTime(3) >= 0
player = ceil(-10*const(size.xscale)),ceil(-10*const(size.xscale))
ignorehitpause = 1

[State 1110, 8]
type = PlayerPush
trigger1 = AnimElemTime(3) >= 0
value = 0

[State 1110, 9]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1110, 10]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1110, 11]
type = ChangeState
trigger1 = !AnimTime
value = 1111
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1111]
type    = A
movetype= A
physics = N
velset = 0,-9*const(size.yscale)
anim = 1101
ctrl = 0
sprpriority = 2
hitcountpersist = 1

[State 1111, 1]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 1111, 2]
type = HitDef
triggerall = (!HitCount && var(5) < 6) || HitCount
trigger1 = (AnimElem = 1 || AnimElem = 2 || AnimElem = 3) && (Time < 12)
attr = S, SA
damage = ceil(25*Fvar(20)),6
animtype = Up
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
givepower = 12,6
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = 2*const(size.xscale), -3.8*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = 2*const(size.xscale), -3.8*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1111, 3]
type = HitDef
triggerall = (!HitCount && var(5) < 6) || HitCount
trigger1 = AnimElem = 4 && (Time < 12)
attr = S, SA
damage = ceil(25*Fvar(20)),6
animtype = Up
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
givepower = 12,6
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-31*const(size.yscale))
hitsound = F5, 2
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 18
ground.velocity = -2.1*const(size.xscale), -3.8*const(size.yscale)
ground.cornerpush.veloff = 0
air.type = High
air.velocity = -2.1*const(size.xscale), -3.8*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1100
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 1111, 4]
type = Width
trigger1 = 1 
player = ceil(-10*const(size.xscale)),ceil(-10*const(size.xscale))
ignorehitpause = 1

[State 1111, 5]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3 && HitCount = 1
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1111, 6]
type = PlayerPush
trigger1 = 1
value = 0

[State 1111, 7]
type = PlaySnd
trigger1 = !Time 
value = S190,0

[State 1111, 8]
type = ChangeState
trigger1 = Vel Y >= 0
value = 1102

;---------------------------------------------------------------------------
;Screw Rush
[Statedef 1150]
type    = S
movetype= A
physics = S
poweradd = 60*(1-var(53))
velset = 0,0
anim = 1150+(5*(Command = "a"))
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1100, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8034
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8034
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1150, 3]
type = VarSet
trigger1 = !var(59) && !Time
var(10) = NumExplod(90000240) != 0

[State 1150, 4]
type = VarSet
trigger1 = var(59) && !Time
var(10) = P2BodyDist X > 74.3

[State 1150, 5]
type = PlaySnd
trigger1 = !Time
value = S1100,0
channel = 3

[State 1150, 6]
type = ChangeState
trigger1 = !AnimTime
value = 1151
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1151]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 1151+(5*(Var(10)))
ctrl = 0
sprpriority = 2

[State 1151, 1]
type = HitDef
trigger1 = Var(5) < 6 && !Time
attr = S, SA
damage = ceil((105+(20*Var(10)))*Fvar(20)), 27+(5*Var(10))
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-41*const(size.yscale))
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 15
ground.velocity = -5.1*const(size.xscale), -1.8*const(size.yscale)
air.type = High
air.velocity = -3.1*const(size.xscale), -2.1*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1150
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 120, 60
givepower = 60, 30

[State 1151, 2]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1151, 3]
type = PosAdd
trigger1 = !Time
x = 16*const(size.xscale)

[State 1151, 4]
type = VelSet
trigger1 = Time = 1
x = (6.5+(6.5*(Var(10))))*const(size.xscale)

[State 1151, 5]
type = Explod
trigger1 = !Time
anim = 1153
ID = 1200
pos = ceil(-41*const(size.xscale)),ceil(-53*const(size.yscale))
postype = P1
facing = 1
vfacing = 1
bindtime = 3
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = -3
ownpal = 1

[State 1151, 6]
type = PlaySnd
trigger1 = !Time
value = S1160,1
channel = 3

[State 1151, 7]
type = ChangeState
trigger1 = !AnimTime
value = 1152
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1152]
type    = S
movetype= I
physics = S
anim = 1152
ctrl = 0
sprpriority = 2

[State 1152, 1]
type = RemoveExplod
trigger1 = !Time
id = 8030

[State 1152, 2]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Screw Rush
[Statedef 1160]
type    = S
movetype= A
physics = S
poweradd = -500
velset = 0,0
anim = 1160
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1100, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8035
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1100, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8035
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = -1
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1160, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1160, 2]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1160, 3]
type = PlaySnd
trigger1 = AnimElem = 3
value = S1100,0
channel = 3

[State 1160, 4]
type = PosAdd
trigger1 = !AnimTime
x = 8*const(size.xscale)

[State 1160, 5]
type = ChangeState
trigger1 = !AnimTime
value = 1161

;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1161]
type    = S
movetype= A
physics = S
velset = 0,0
anim = 1151
ctrl = 0
sprpriority = 2

[State 1161, 1]
type = Explod
trigger1 = !Time
anim = 1153
ID = 1200
pos = ceil(-41*const(size.xscale)),ceil(-53*const(size.yscale))
postype = P1
facing = 1
vfacing = 1
bindtime = 3
removetime = -2
scale = const(size.xscale),const(size.yscale)
sprpriority = -3
ownpal = 1

[State 1161, 2]
type = PlaySnd
trigger1 = !Time
value = S1160,1
channel = 3

[State 1161, 3]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1010, 4]
type = VarSet
trigger1 = 1
var(16) = 0

[State 1010, 5]
type = VarSet
trigger1 = 1
var(17) = 0

[State 1010, 6]
type = ChangeState
trigger1 = 1
value = 1162
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1162]
type    = U
movetype = H
physics = S
ctrl = 0
sprpriority = 2
hitdefpersist = 1

[State 1161, 1]
type = VarAdd
trigger1 = 1
var(17) = 1

[State 1161, 2]
type = PosAdd
trigger1 = Var(17) = 2
x = 8*const(size.xscale)

[State 1161, 3]
type = VelSet
trigger1 = Var(17) = 2
x = 17.5*const(size.xscale)

[State 1161, 4]
type = StateTypeSet
trigger1 = Time = 1
movetype = A

[State 1161, 5]
type = LifeAdd
trigger1 = !Time
value = GetHitVar(damage)
kill = 1

[State 1161, 6]
type = VarAdd
trigger1 = !Time && GetHitVar(damage)
var(16) = 1
ignorehitpause = 1

[State 1161, 7]
type = HitOverride
trigger1 = Var(16) < 1
attr = SCA,AA,AP
slot = 0
stateno = 1162
time = 1

[State 1161, 8]
type = HitDef
trigger1 = Var(5) < 6 && !Time && PrevStateNo != 1162
attr = S, SA
damage = ceil(145*Fvar(20)),37
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
pausetime = 8,8
sparkno = S6001
sparkxy = -9, ceil(-41*const(size.yscale))
hitsound = F5, 3
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 15
ground.velocity = -5.1*const(size.xscale), -1.8*const(size.yscale)
air.type = High
air.velocity = -3.1*const(size.xscale), -2.1*const(size.yscale)
air.hittime = 100
fall = 1
fall.recover = 0
yaccel = .35*const(size.yscale)
id = 1150
chainID = -1
nochainID = -1
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1
getpower = 0
givepower = 60, 30

[State 1151, 9]
type = VarAdd
trigger1 = NumTarget && MoveHit && Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 1161, 10]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1161, 11]
type = ChangeState
trigger1 = !AnimTime
value = 1163
;---------------------------------------------------------------------------
;Screw Attack
[Statedef 1163]
type    = S
movetype= I
physics = S
velset = 0,0
anim = 1162
ctrl = 0
sprpriority = 2

[State 1163, 1]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1163, 2]
type = RemoveExplod
trigger1 = !Time
id = 8030

[State 1163, 3]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Mine Shot
[Statedef 1200]
type    = S
movetype= I
physics = S
poweradd = 40
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1200, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8036
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1200, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8036
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1200, 3]
type = Helper
trigger1 = AnimElem = 6
name = "Mine Shot" 
ID = 1200
stateno = 1201
pos = ceil(12*const(size.xscale)),ceil(-18*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1200, 4]
type = VarSet
trigger1 = !Time
v = 11
value = 0

[State 1200, 5]
type = VarSet
trigger1 = !var(59) && !Time
var(10) = NumExplod(90000240) != 0

[State 1200, 6]
type = VarSet
trigger1 = var(59) && !Time
var(10) = P2BodyDist X > 60

[State 1200, 7]
type = VarRandom
trigger1 = var(59) && Time >= 1
v = 11
range = 0,2

[State 1200, 8]
type = Null
trigger1 = AnimElem = 4
var(37) = 0

[State 1200, 9]
type = PlaySnd
trigger1 = AnimElem = 6
value = S1160,0

[State 1200, 10]
type = VarSet
trigger1 = AnimElem = 6
var(18) = 1

[State 1200, 11]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Mine
[Statedef 1201]
type    = A
movetype= I
physics = N
poweradd = 40
velset = (2+(Cond(parent,Var(10) = 1,4.7,0)))*const(size.xscale),-3.8*const(size.yscale)
anim = 1201
ctrl = 0
sprpriority = 2

[State 1201, 1]
type = StateTypeSet
trigger1 = Time = 19
movetype = A

[State 1201, 2]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 1201, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1202
;---------------------------------------------------------------------------
;Mine
[Statedef 1202]
type    = S
movetype= A
physics = N
velset = 0,0
anim = 1202
ctrl = 0
sprpriority = 5

[State 1202, 1]
type = HitDef
trigger1 = root,var(5) < 6
attr = S, SA
damage = ceil(80*root,Fvar(20)),20
animtype = Hard
guardflag = MA
hitflag = MAF
priority = 4, Hit
getpower = 0
givepower = 50, 25
pausetime = 1,3
sparkno = S6001
sparkxy = -9, ceil(-8*const(size.yscale))
hitsound = F5, 4
guardsound = F6, 0
ground.type = High
ground.slidetime = 11
ground.hittime  = 15
ground.velocity = -0.8*const(size.xscale), -6.8*const(size.yscale)
ground.cornerpush.veloff = 0
guard.velocity = -2.4*const(size.xscale)
air.type = Low
air.velocity = -4.8*const(size.xscale),-4.1*const(size.yscale)
air.hittime = 100
yaccel = .35*const(size.yscale)
fall = 1
fall.recover = 0
id = 1200
chainID = -1
nochainID = 1200
hitonce = 0
kill = 1
guard.kill = 1
fall.kill = 1
numhits = 1

[State 3055, 2]
type = ParentVarAdd
trigger1 = NumTarget && MoveHit && root,Fvar(21) > .3
fvar(21) = -0.1
ignorehitpause = 1
persistent = 0

[State 3055, 4]
type = PlaySnd
trigger1 = !Time
value = S1160,1

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 3055, 5]
type = ParentVarSet
trigger1 = !AnimTime
var(18) = 0

[State 3055, 6]
type = ChangeAnim
trigger1 = !AnimTime
value = 1

[State 3055, 7]
type = DestroySelf
trigger1 = !NumTarget && (Anim != 1 && !AnimTime || Anim = 1)
;---------------------------------------------------------------------------
;Mine Shot
[Statedef 1210]
type    = S
movetype= I
physics = S
poweradd = -500
velset = 0,0
anim = 1200
ctrl = 0
sprpriority = 2
facep2 = 1

[State 1000, 1]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 1
anim = 8037
ID = 8030
pos = 87,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 2]
type = Explod
triggerall = !NumPartner && !NumExplod(8030)
trigger1 = !Time && TeamSide = 2
anim = 8037
ID = 8030
pos = 231,23
postype = left
facing = 1
vfacing = 1
bindtime = -1
removetime = 42
scale = 1,1
sprpriority = -996
ownpal = 1
removeongethit = 1

[State 1000, 3]
type = Helper
trigger1 = AnimElem = 4
name = "Mine Shot" 
ID = 1200
stateno = 1211
pos = ceil(12*const(size.xscale)),ceil(-18*const(size.yscale))
postype = p1
facing = 1
ownpal = 1
size.xscale = const(size.xscale)
size.yscale = const(size.yscale)

[State 1000, 10]
type = PlaySnd
trigger1 = AnimElem = 4
value = S1160,0

[State 1000, 14]
type = VarSet
trigger1 = AnimElem = 6
var(18) = 1

[State 1100, 9]
type = PalFX
trigger1 = !(GameTime%2)
time = 1
add = 256, 256, 256
mul = 256,256,256
invertall = 0
color = 256

[State 1100, 10]
type = PlaySnd
trigger1 = !Time
value = F799,0
channel = 10

[State 1000, 15]
type = ChangeState
trigger1 = !AnimTime
value = 0
ctrl = 1
;---------------------------------------------------------------------------
;Mine
[Statedef 1211]
type    = A
movetype= I
physics = N
velset = 2*const(size.xscale),-3.8*const(size.yscale)
anim = 1201
ctrl = 0
sprpriority = 2

[State 1201, 1]
type = StateTypeSet
trigger1 = Time = 19
movetype = A

[State 1201, 2]
type = VelAdd
trigger1 = 1
y = .44*const(size.yscale)

[State 1201, 3]
type = ChangeState
trigger1 = Vel Y > 0 && Pos Y > -Vel Y
value = 1212
;---------------------------------------------------------------------------
;Mine
[Statedef 1212]
type    = S
movetype= A
physics = N
velset = 0,0
ctrl = 0
sprpriority = 5

[State 0, PosSet]
type = PosSet
trigger1 = !Time
y = 0

[State 0, ChangeState]
type = ChangeState
trigger1 = Time = 60
value = 1202
